<html>
<head>
    <meta charset="utf-8">
    <title>python5期66666</title>
</head>

<body>
<button id="pres">请按下我</button>

<script>
    var aa=document.getElementsByTagName("button")
    aa[0].onclick=function () {
        alert("点击事件触发了哟！！！")
        var bb=document.getElementsByTagName("p")[0]
        bb.setAttribute("style","color:red")
    }
</script>

</body>
</html>














